﻿#include "csvthread.h"

CsvThread::CsvThread(QObject *parent) : QObject(parent)
{
    m_worker = new CsvWorker();
    m_worker->moveToThread(&m_workThread);
    connect(this, &CsvThread::sigWriteIn, m_worker, &CsvWorker::slotWriteIn);
    connect(this, &CsvThread::sigReadOut, m_worker, &CsvWorker::slotReadOut);
    connect(&m_workThread, &QThread::finished, m_worker, &QObject::deleteLater);
    m_workThread.start();
}

CsvThread::~CsvThread()
{

}

void CsvThread::WriteIn(CsvData m_csData)
{
    emit sigWriteIn(m_csData);
}

void CsvThread::ReadOut()
{
    emit sigReadOut();
}
